package store.lunangangster.bpmn.model;

/**
 * ReceiveTask是最简单的一种{@link Task}，其用于接收来自外部的 (相对与当前流程{@link Process})
 * 消息 ({@link Message})。当消息被完全接收时，当前任务完成。
 *
 * <p>ReceiveTask经常用于开启一个Process，当接收到外部的信息时，实例化一个{@link Process}。
 * 为了使实例化能够成功，务必需要保证ReceiveTask的instantiate属性为true， 并且当前任务不能有
 * 任何的incoming {@link SequenceFlow}
 *
 * @author cwk
 * @version 1.0
 */
public class ReceiveTask extends Task {

  protected String messageRef;
  protected String operationRef;
  protected String implementation;
  protected boolean instantiate;

  public String getMessageRef() {
    return messageRef;
  }

  public void setMessageRef(String messageRef) {
    this.messageRef = messageRef;
  }

  public String getOperationRef() {
    return operationRef;
  }

  public void setOperationRef(String operationRef) {
    this.operationRef = operationRef;
  }

  public String getImplementation() {
    return implementation;
  }

  public void setImplementation(String implementation) {
    this.implementation = implementation;
  }

  public boolean isInstantiate() {
    return instantiate;
  }

  public void setInstantiate(boolean instantiate) {
    this.instantiate = instantiate;
  }

  @Override
  public String getModelType() {
    return "RECEIVE_TASK";
  }
}
